const cloud = require('wx-server-sdk')
cloud.init()

const db = cloud.database()
const _ = db.command

// 云函数入口函数
exports.main = async(event, context) => {
  return await db.collection('todos').add({
    data: {
      index: event.index,
          name: event.name,
          rolename: event.rolename,
          image: event.image,
          sex: event.sex,
          money: event.money,
          str: event.str,
          con: event.con,
          siz: event.siz,
          dex: event.dex,
          app: event.app,
          int: event.int,
          pow: event.pow,
          edu: event.edu,
          summary: event.summary,
          HP:event.HP,
          ch:event.ch,
          zt:event.zt,
          ability:event.ability

    }
  })
}